package com.cmy.constant;

import com.cmy.enums.DataBaseEnums;
import com.cmy.utils.DDLResourceLoader;
import org.springframework.core.io.Resource;
import java.util.Map;
import java.util.regex.Pattern;

/**
 * @author : Cmy
 * @date : 2025-03-19 13:51
 */
public class DDLConstant {

    /**
     * 批量处理大小
     */
    public static final int BATCH_SIZE = 1000;

    public static String DB_TYPE = DataBaseEnums.MySQL.getName();

    // 匹配 V版本号__格式的正则表达式
    public static final Pattern VERSION_PATTERN = Pattern.compile("^V((\\d+\\.)+\\d+)__");

    public static final Pattern VERSION_PATTERN_SQL = Pattern.compile("^V((\\d+\\.)+\\d+)__.*\\.sql$");

    public static final Pattern R_VERSION_PATTERN_CSV = Pattern.compile("^R__.*\\.csv$");

    public static final Map<String, Resource> nameResourceMap;

    static {
        nameResourceMap = DDLResourceLoader.loadFilenameResourceMap();
    }
}

    